home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
- File: ScriptRunnerInit.cpp
-
- Contains: Init routines
-
- Written by: Sue Dumont
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- ------------------------------------------------------------------------------*/
-
- // -- Compiler/Preprocessor Switches --
-
- #ifndef _COMPILERDEFS_
- #include "CompDefs.h"
- #endif
-
- // -- OpenDoc Utilities --
-
- #ifndef _EXCEPT_
- // Exceptions define several important macros (ie. CHECKENV)
- // which are used in the SOM method dispatch glue. If Except.h
- // is not included early enough, exceptions may not be thrown
- // correctly when returning from a SOM method with "ev" parameter set.
- #include <Except.h>
- #endif
-
- // -- SOM Includes --
-
- #ifndef som_xh
- #include <som.xh>
- #endif
-
- #ifndef SOM_SOMObject_xh
- #include <somobj.xh>
- #endif
-
- // -- ScriptRunner Includes --
-
- #ifndef SOM_SampleCode_ScriptRunner_xh
- #include "ScriptRunner.xh"
- #endif
-
- // -- OpenDoc Utilities --
-
- #ifndef __USERSRCM__
- #include <UseRsrcM.h>
- #endif
-
- #ifndef _ODMEMORY_
- #include <ODMemory.h>
- #endif
-
- // -- MacToolbox Includes --
-
- #ifndef __CODEFRAGMENTS__
- #include <CodeFragments.h>
- #endif
-
- /*
- #ifdef applec
- #pragma segment ScriptRunnerInit
- #endif
- */
-
- #pragma segment ScriptRunnerInit
-
- //------------------------------------------------------------------------------
- // Prototypes
- //------------------------------------------------------------------------------
-
- extern "C" pascal OSErr ScriptRunnerCFMInit(CFragInitBlockPtr initBlkPtr);
-
-
- //------------------------------------------------------------------------------
- // Functions
- //------------------------------------------------------------------------------
-
- extern "C" pascal OSErr ScriptRunnerCFMInit(CFragInitBlockPtr initBlkPtr)
- {
- // We are using OpenDoc's memory management calls, so we
- // must initialize the interface to the memory manager.
- OSErr err1 = InitODMemory();
-
- // We must also capture the relevant information about
- // our library file so that we may access our resources.
-
- OSErr err2 = InitLibraryResources(initBlkPtr);
-
- return (OSErr) (err1 != noErr) ? err1 : err2;
- }
-